//
//  CYTransferEnterCell.m
//  CaiYun
//
//  Created by 今日信息科技 on 2017/9/8.
//  Copyright © 2017年 今日信息科技. All rights reserved.
//

#import "CYTransferEnterCell.h"
@interface CYTransferEnterCell ()
@property (nonatomic, strong) CYLabel *titleLBL;
@property (nonatomic, strong) CYLabel *contentLBL;
@end
@implementation CYTransferEnterCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (CYLabel *)titleLBL{
    if (!_titleLBL) {
        _titleLBL = [[CYLabel alloc]initWithText:_title size:AL(PT(28)) textcolor:TEXT_BLACK_COLOR];
        [self addSubview:_titleLBL];
        
        [_titleLBL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(self).with.offset(AL(PT(26)));
            make.size.mas_equalTo(_titleLBL.bounds.size);
        }];
    }
    return _titleLBL;
}

- (CYLabel *)contentLBL{
    if (!_contentLBL) {
        _contentLBL = [[CYLabel alloc]initWithText:_content size:AL(PT(28)) textcolor:TEXT_BLACK_COLOR];
        [self addSubview:_contentLBL];
        
        [_contentLBL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self).with.offset(- AL(PT(26)));
            make.size.mas_equalTo(_titleLBL.bounds.size);
        }];
    }
    return _contentLBL;
}

- (void)setTitle:(NSString *)title{
    if (_title != title)
        _title = title;
    self.titleLBL.text = title;
    [_titleLBL mas_updateConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(_titleLBL.bounds.size);
    }];
}


- (void)setContent:(NSString *)content{
    if (_content != content)
        _content = content;
    self.contentLBL.text = content;
    [_contentLBL mas_updateConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(_contentLBL.bounds.size);
    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
